package com.fishv.fishvdianping.common;

import com.fishv.fishvdianping.model.vo.UserVO;
import lombok.Data;

/**
 * @author yuwei
 * @date 18:43 2024/10/20
 */
@Data
public class UserHolder {
    private static ThreadLocal<UserVO> threadLocal = new ThreadLocal<>();
    public static void saveUser(UserVO userVO){
        threadLocal.set(userVO);
    }
    public static UserVO getUser(){
        return threadLocal.get();
    }
    public static void removeUser() {
        threadLocal.remove();
    }
}
